#include <unistd.h>
#include <mpi.h>
#include <iostream>
using namespace std;


int 
main(int argc, char * argv[])
{
  int rank;
  int* sendbuf,*recvbuf;
  MPI_Status status;
  MPI_Init(&argc, &argv);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  sendbuf = NULL;
  recvbuf = NULL;
  if( rank == 0)
  	MPI_Sendrecv(&sendbuf, 1, MPI_INT, 1, 99,
	  		   &recvbuf, 1, MPI_INT, 1, 99,
			   MPI_COMM_WORLD, &status);
  if( rank == 1)
  	MPI_Sendrecv(&sendbuf, 1, MPI_INT, 0, 99,
	  		   &recvbuf, 1, MPI_INT, 0, 99,
			   MPI_COMM_WORLD, &status);
  MPI_Finalize();
  return 0;
}

